#define _CRT_SECURE_NO_WARNINGS
#include"Dlist.h"

void test01()
{
	DListNode* phead = DListInit();
	DListPushBach(phead, 1);
	DListPushBach(phead, 2);
	DListPushBach(phead, 3);
	DListPushBach(phead, 4);

	DListPrint(phead);// 1 2 3 4
}
void test02()
{
	DListNode* phead = DListInit();
	DListPushBach(phead, 1);
	DListPushBach(phead, 2);
	DListPushBach(phead, 3);
	DListPushBach(phead, 4);

	DListPrint(phead);// 1 2 3 4

	DListPopBack(phead);
	DListPopBack(phead);
	//DListPrint(phead);// 1 2 
	DListPopBack(phead);
	DListPopBack(phead);
	//DListPopBack(phead);
}

void test03()
{
	DListNode* phead = DListInit();
	DListPushFront(phead, 1);
	DListPushFront(phead, 2);
	DListPushFront(phead, 3);
	DListPushFront(phead, 4);

	DListPrint(phead);//4 3 2 1

}

void test04()
{
	DListNode* phead = DListInit();
	DListPushFront(phead, 1);
	DListPushFront(phead, 2);
	DListPushFront(phead, 3);
	DListPushFront(phead, 4);

	DListPopFront(phead);
	DListPopFront(phead);
	DListPopFront(phead);
	DListPopFront(phead);
	DListPopFront(phead);

	DListPrint(phead);
}
void test05()
{
	DListNode* phead = DListInit();
	DListPushFront(phead, 1);
	DListPushFront(phead, 2);
	DListPushFront(phead, 3);
	DListPushFront(phead, 4);

	DListPushBach(phead, 1);
	DListPushBach(phead, 2);
	DListPushBach(phead, 3);
	DListPushBach(phead, 4);


	DListPrint(phead);//4 3 2 1 1 2 3 4


	DListPopBack(phead);
	DListPopFront(phead);
	DListPrint(phead);//3 2 1 1 2 3

	DListDestroy(phead);
	phead = NULL;

}
int main()
{
	//test01();
	//test02();
	//test03();
	//test04();
	test05();
	
	return 0;
}